#include <iostream>

// 基类
class Animal {
public:
    void eat() {
        std::cout << "Animal is eating." << std::endl;
    }
};

// 派生类
class Dog : public Animal {
public:
    void bark() {
        std::cout << "Dog is barking." << std::endl;
    }
};

int main() {
    Dog myDog;
    myDog.eat(); // 通过继承，Dog对象可以调用Animal类中的eat()方法
    myDog.bark();
    return 0;
}